home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Presen… 1994 February Supplement / ARPL-Feb-94-Supplement-PowerPC.iso / 3rd Party PowerPC Demo Apps / Aldus FreeHand / Aldus FreeHand 4.0 TV / Aldus FreeHand 4.0 TV.rsrc / Post_1231 < prev    next >
Encoding:
Text File  |  1994-01-25  |  2.4 KB  |  150 lines

  1. /makepattern defed /xt xdf
  2. xt not {/yt save def} if
  3.  
  4.  /PATmp{
  5. exch 
  6. dup length 3 add dict copy 
  7. begin
  8. currentdict /Multi known not {/Multi 1 def} if
  9. Multi 1 ne {
  10. /UserProc /PaintProc load def
  11. /PaintProc {
  12. begin
  13. 0 1 Multi 1 sub {
  14. PaintColors 1 index get PATsc
  15. PaintData exch get
  16. gsave currentdict UserProc grestore
  17. }for 
  18. end
  19. } bdf
  20. } if
  21. currentdict
  22. end
  23. exch makepattern
  24.  }bdf
  25.  
  26.  
  27.  /PATsp{
  28. dup /PaintType get 2 eq
  29. {
  30. exch aload length 4 eq
  31. {5 -1 roll}
  32. {spots exch get 0 4 getinterval aload pop
  33. 4 {4 index mul 4 1 roll} repeat 6 -2 roll pop}ifelse 
  34. [/Pattern /DeviceCMYK] setcolorspace
  35. }if
  36. setpattern
  37.  }bdf
  38.  /PATfill{{{eofill}fp}{{fill}fp}ifelse}bdf
  39.  /PATprestroke{}bdf
  40.  /PATstroke{stroke}bdf
  41. xt not {yt restore} if
  42. xt {/yt save def} if
  43.  
  44.  /PATtcalc{
  45. gsave
  46. exch concat 
  47. matrix currentmatrix exch 
  48. 2 ne {
  49. dup 4 get exch dup 5 get exch
  50. XStep 0 dtransform round exch round exch
  51. XStep div exch XStep div exch
  52. 0 YStep dtransform round exch round exch
  53. YStep div exch YStep div exch
  54. 7 -3 roll astore
  55. } if
  56. grestore
  57.  }bdf
  58.  
  59.  /PATmp{
  60. exch 
  61. dup 
  62. length 8 add 
  63. dict copy 
  64. begin 
  65. TilingType PATtcalc 
  66. /PATcurrentMtx xdf 
  67. currentdict /Multi known not {/Multi 1 def} if
  68. /FontType 3 def
  69. /Encoding 256 array def
  70. 3 string 0 1 255 
  71. {Encoding exch dup 3 index cvs cvn put} for pop
  72. /FontMatrix matrix def
  73. /FontBBox BBox def
  74. /BuildChar {
  75. mark 3 1 roll
  76. exch begin
  77. Multi 1 ne {PaintData exch get}{pop}ifelse
  78. PaintType 2 eq Multi 1 ne or
  79. {XStep 0 FontBBox aload pop setcachedevice}
  80. {XStep 0 setcharwidth}ifelse
  81. currentdict 
  82. /PaintProc load 
  83. end
  84. gsave exec grestore
  85. cleartomark
  86. }bdf
  87. currentdict 
  88. end
  89. /foo exch
  90. definefont
  91.  }bdf
  92.  
  93.  
  94.  /PATsp{
  95. /PATcurrent xdf
  96. PATcurrent /PaintType get 2 eq
  97. {/PATcolor xdf}if
  98.  }bdf
  99.  
  100.  /PATpcalc{
  101. PATcurrent begin
  102. gsave
  103. PATcurrentMtx setmatrix
  104. BBox aload pop pop pop translate
  105. pathbbox
  106. grestore
  107. YStep div ceiling 4 1 roll
  108. XStep div ceiling 4 1 roll
  109. YStep div floor 4 1 roll
  110. XStep div floor 4 1 roll
  111. 2 index sub cvi abs
  112. exch 3 index sub cvi abs exch
  113. 4 2 roll
  114. YStep mul exch XStep mul exch
  115. end
  116.  }bdf
  117.  
  118.  
  119.  /PATfill{
  120. {{eoclip}fp}{{clip}fp}ifelse
  121. PATpcalc 
  122. newpath
  123. PATcurrent dup begin
  124. setfont
  125. PATcurrentMtx setmatrix
  126. PaintType 2 eq {PATcolor vc} if
  127. 3 index string 
  128. 0 1 Multi 1 sub { 
  129. 3 index 3 index moveto
  130. Multi 1 ne {dup PaintColors exch get vc} if
  131. 0 1 7 index 1 sub { 
  132. 2 index 
  133. exch 
  134. 2 index put
  135. } for
  136. pop 
  137. 3 index 
  138. {
  139. currentpoint 
  140. 2 index show
  141. YStep add moveto
  142. }repeat
  143. }for
  144. 5 {pop} repeat 
  145. end
  146.  }bdf
  147.  /PATprestroke{{strokepath}fp}bdf
  148.  /PATstroke{false PATfill}bdf
  149. xt {yt restore} if